package course_9_2.eg;

import java.util.Scanner;
import java.lang.*;
public class ExceptionTest {
    public static void main(String[] args) {
        while(true) {
            try {
                Scanner scanner = new Scanner(System.in);
                System.out.println("Please Enter Two Numbers:");
                System.out.println("Division:" + (scanner.nextInt() / scanner.nextInt()));
                System.out.println((new int[4])[4]);
                break;
            } catch (Exception e) {
                System.out.print("Error:");
                System.out.println(e.getMessage());
            } finally {
                continue;
            }

//        catch (InputMismatchException inputMismatchException) {
//            System.out.println(inputMismatchException.getMessage());
//            System.out.println("You did not enter a number!");
//
//        } catch (ArithmeticException arithmeticException) {
//            System.out.println(arithmeticException);
//            System.out.println(arithmeticException.getMessage());
//            System.out.println(arithmeticException.getLocalizedMessage());
//            System.out.println("The first number cannot be divided by zero");
//        }
        }
    }
}
